var flag = true
$('.header .classify').click(function() {
  if (flag) {
    $('.nav').slideDown()
    flag = false
    /* if ($('.nav').css('display') == 'block') {
      $('body').on('click', function(e) {
        console.log(e.target.className)
        if (e.target.className != 'list') {
          $('.nav').slideUp()
          flag = true
        }
      })
    } */
  } else {
    $('.nav').slideUp()
    flag = true
  }
})
$('.nav .list').click(function() {
  $('.nav').slideUp()
  flag = true
})
if ($('.swiper-container').length) {
  var mySwiper = new Swiper('.swiper-container', {
    autoplay: 2000,
    autoplayDisableOnInteraction: false,
    loop: true,
    pagination: '.swiper-pagination',
    paginationClickable: true,
    onSlideChangeEnd: function(swiper) {
      // 如果需要分页器 // 如果需要前进后退按钮
      if (swiper.activeIndex == 3) {
        $('.iconfont').css({ color: '#737373' })
        $('.swiper-pagination span').css({ background: '#737373' })
      } else {
        $('.iconfont').css({ color: '#fff' })
        $('.swiper-pagination span').css({ background: '#fff' })
      }
    }
  })
}
